package SPAN::InterfaceModel::Action;

use warnings;
use strict;

use Reaction::Class;

class Action is 'Reaction::InterfaceModel::Action', which {
    override 'error_for_attribute' => sub {
        my ( $self, $attr ) = @_;
        if ( $attr->is_required ) {
            my $predicate = $attr->predicate;
            unless ( $self->$predicate ) {
                return 'required';
            }
        }
        return super();
    };
};

1;
